package com.kaka.mapper;

import com.kaka.pojo.Dept;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface DeptMapper {

    @Select("select * from tb_dept")
    List<Dept> selectAll();

    @Delete("delete from tb_dept where id = #{id}")
    void deleteById(Integer id);

    @Insert("insert into tb_dept (name, create_time, update_time) VALUE (#{name}, #{createTime}, #{updateTime})")
    void insert(Dept dept);

    @Select("select * from tb_dept where id = #{id}")
    Dept selectById(Integer id);

    @Update("update tb_dept set name = #{name}, update_time= #{updateTime} where id = #{id}")
    void update(Dept dept);
}
